]> permondes.de Git - Analog_Engine.git/blobdiff - scripts/TP1 03.08 Charge in em field.LACE
Potential of charged sphere
[Analog_Engine.git] / scripts / TP1 03.08 Charge in em field.LACE
diff --git a/scripts/TP1 03.08 Charge in em field.LACE b/scripts/TP1 03.08 Charge in em field.LACE
new file mode 100644 (file)
index 0000000..955f475
--- /dev/null
@@ -0,0 +1,31 @@
+#PROGRAM-ID ChargeInEMfield
+#VERSION 20240116
+# A mass m with charge q>0 is located in a static electro-magnetic field [0,0,E], [0,-B,0].
+# Find the trajetory
+# Differential equation (Lorentz force): 
+#   x'' = omega*z'
+#   z'' = a*omega^2 - omega*x'
+# good start settings are omega=0,92, a*omega^2=0,05
+
+# coefficient definition
+alias coefficient.1 -> omega_x # -omega for x'
+coefficient.2 (+1) -> a*omega^2
+alias coefficient(3) -> omega_z # omega for z'
+
+# solving the DE
+iintegrate (x'') -> -x'
+iintegrate (-x') -> x
+
+coefficient.omega_x (-x') -> -omega*x'
+#cmultiply (-x', omega_x) -> omega*x'
+
+iintegrate (a*omega^2, -omega*x') -> -z' # input is z''
+iintegrate (-z') -> z
+invert (-z') -> z'
+
+coefficient.omega_z (z') -> omega*z'
+#cmultiply (z', omega_z) -> omega*z'
+assign omega*z' -> x''
+
+output(x) -> out.x
+output(z) -> out.z